package BanqueGestion;

/**
 * Interface definition: CompteBancaire.
 * 
 * @author OpenORB Compiler
 */
public class _CompteBancaireStub extends org.omg.CORBA.portable.ObjectImpl
        implements CompteBancaire
{
    static final String[] _ids_list =
    {
        "IDL:BanqueGestion/CompteBancaire:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = BanqueGestion.CompteBancaireOperations.class;

    /**
     * Read accessor for numeroDeCompte attribute
     * @return the attribute value
     */
    public int numeroDeCompte()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_numeroDeCompte",true);
                    _input = this._invoke(_output);
                    return _input.read_long();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_numeroDeCompte",_opsClass);
                if (_so == null)
                   continue;
                BanqueGestion.CompteBancaireOperations _self = (BanqueGestion.CompteBancaireOperations) _so.servant;
                try
                {
                    return _self.numeroDeCompte();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for argent attribute
     * @return the attribute value
     */
    public float argent()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_argent",true);
                    _input = this._invoke(_output);
                    return _input.read_float();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_argent",_opsClass);
                if (_so == null)
                   continue;
                BanqueGestion.CompteBancaireOperations _self = (BanqueGestion.CompteBancaireOperations) _so.servant;
                try
                {
                    return _self.argent();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for nom attribute
     * @return the attribute value
     */
    public String nom()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_nom",true);
                    _input = this._invoke(_output);
                    return _input.read_string();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_nom",_opsClass);
                if (_so == null)
                   continue;
                BanqueGestion.CompteBancaireOperations _self = (BanqueGestion.CompteBancaireOperations) _so.servant;
                try
                {
                    return _self.nom();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Write accessor for nom attribute
     * @param value the attribute value
     */
    public void nom(String value)
    {
        while(true)
        {
            if (!this._is_local())
            {
                    org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_set_nom",true);
                    _output.write_string(value);
                    _input = this._invoke(_output);
                    return;
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_set_nom",_opsClass);
                if (_so == null)
                   continue;
                BanqueGestion.CompteBancaireOperations _self = (BanqueGestion.CompteBancaireOperations) _so.servant;
                try
                {
                    _self.nom(value);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation deposerArgent
     */
    public void deposerArgent(float argent)
        throws BanqueGestion.CompteBancairePackage.NegativeAmount
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("deposerArgent",true);
                    _output.write_float(argent);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(BanqueGestion.CompteBancairePackage.NegativeAmountHelper.id()))
                    {
                        throw BanqueGestion.CompteBancairePackage.NegativeAmountHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("deposerArgent",_opsClass);
                if (_so == null)
                   continue;
                BanqueGestion.CompteBancaireOperations _self = (BanqueGestion.CompteBancaireOperations) _so.servant;
                try
                {
                    _self.deposerArgent( argent);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation retirerArgent
     */
    public float retirerArgent(float argent)
        throws BanqueGestion.CompteBancairePackage.NotEnoughMoney, BanqueGestion.CompteBancairePackage.NegativeAmount
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("retirerArgent",true);
                    _output.write_float(argent);
                    _input = this._invoke(_output);
                    float _arg_ret = _input.read_float();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(BanqueGestion.CompteBancairePackage.NotEnoughMoneyHelper.id()))
                    {
                        throw BanqueGestion.CompteBancairePackage.NotEnoughMoneyHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(BanqueGestion.CompteBancairePackage.NegativeAmountHelper.id()))
                    {
                        throw BanqueGestion.CompteBancairePackage.NegativeAmountHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("retirerArgent",_opsClass);
                if (_so == null)
                   continue;
                BanqueGestion.CompteBancaireOperations _self = (BanqueGestion.CompteBancaireOperations) _so.servant;
                try
                {
                    return _self.retirerArgent( argent);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
